<?php
/**
* @file PortaMx.template.php
* Main template for the Forumpage.
*
* @author PortaMx - Portal Management Extension
* @author Copyright 2008-2011 by PortaMx - http://portamx.com
* @Version: 1.0 RC4
* @Date: 23.02.2011
*/

/**
* The main template for frontpage and Page blocks.
*/
function template_main()
{
	global $context, $options, $txt;

	if(!empty($context['pmx']['show_pagespanel']))
	{
		$placed = 0;
		if(isset($context['pmx']['viewblocks']['front']))
		{
			$spacer = intval(!empty($context['pmx']['show_pagespanel']));
			$placed = PortaMx_ShowBlocks('front', $spacer, 'before');

			$spacer = intval(count($context['pmx']['viewblocks']['front'])) > $placed;
			PortaMx_ShowBlocks('pages', $spacer);

			PortaMx_ShowBlocks('front', 0, 'after');
		}
		else
			PortaMx_ShowBlocks('pages');
	}
	else
		PortaMx_ShowBlocks('front');
}

/**
* The Error Subtemplate.
*/
function template_portamx_error()
{
	global $context, $txt;

	echo '
		<div style="margin:0 auto; width:80%; margin-bottom:'. $context['pmx']['settings']['panelpad'] .'px; text-align:center;">
			<div class="title_bar" style="margin-bottom:-2px;">
				<h3 class="titlebg">', $context['pmx_error_title'], '</h3>
			</div>
			<span class="upperframe"><span></span></span>
				<div class="roundframe middletext"'. (!empty($context['pmx_style_isCore']) ? 'style="margin-top:-1px;"' : '') .'>
					'. $context['pmx_error_text'] .'<br /><br />
					<input class="button_submit" type="button" name="back" value="'. $txt['page_reqerror_button'] .'" onclick="window.history.back()" />
				</div>
			<span class="lowerframe"><span></span></span>
		</div>';
}
?>
